${page.setTitle("push-center| GOPS")}
<style type="text/css">
    .l-table-edit {}
    .l-table-edit-td{ padding:4px;}
    .l-button-submit,.l-button-reset{width:80px; float:left; margin-left:10px; padding-bottom:2px;}
</style>
${token()}
<div class="body-pla-content">
 <form action="" method="post" id="domainapptemplate" name="domainapptemplate">
 <input type="hidden" name="id" value="${domainapptemplate.id}"/>
 <table class="l-table-edit" >
            <tr>
                <td align="right" >域：</td>
                <td align="left" >
						<input name="domainId" type="text" id="domainId"  maxlength="30" value="${domainapptemplate.domainId}"  validate="{required:true,maxlength:30}" readonly="readonly"/>
				</td>
			 </tr> 
			 <tr>
			 	<td align="right" >应用模板：</td>
                 <td align="left" >
                	<input name="appTemplateId" type="text" id="appTemplateId" maxlength="30" value="${domainapptemplate.appTemplateId}"  validate="{required:true,maxlength:30}" readonly="readonly"/>
				</td>
			 </tr>
			 <tr>
				<td align="right" >优先级：</td>
                 <td align="left" >
                	<input name="priority" type="text" id="priority" maxlength="30" value="${domainapptemplate.priority}"  validate="{required:true,maxlength:30}"/>
                	<span>(必填,系统根据优先级进行发送)</span>
				</td>
			 </tr> 
             <tr>
				 <td align="right" >备注：</td>
                <td align="left" colspan=3>
                <textarea rows="3" cols="60" name="memo" id="memo" >${domainapptemplate.memo}</textarea>
				</td>
            </tr>
            <tr>
            	<td></td>
            	<td colspan=3> <input type="button" value="修改" id="dosubmit" class="l-button l-button-submit"/>  </td>
            	<td align="left"></td>
            </tr>
        </table>
    </form>
</div>
<script type="text/javascript">

$(function () {
	epay_enum.iniSelect();
	$("#dosubmit").click(function(){
		var queryString = $('#domainapptemplate').serializeArray();  
	    $.ajax({
	        url: "${appServer}/domainapptemplate/update.json",   
	        data: queryString, 
	        type: "POST",
	        success: function(result) {
	        	if(result.hasError) {
					$.ligerDialog.error(result.message);
	        	}else{
	        		$.ligerDialog.success(result.message);
	        		parent.window.search();
	        		parent.$.ligerDialog.close();
	        		parent.$.ligerDialog.hide();
	        	}
	        }
	    });	
		return true;
	});
 
	  //-------------------domain ----------------------
	 
	  $(function ()
        { 
            $("#domainId").ligerComboBox({
                onBeforeOpen: f_selectContact, width:200
            });
        });
        function f_selectContact()
        {
            $.ligerDialog.open({ 
            	title: ' 请选择域', 
            	name:'winselector',
            	width: 700, 
            	height: 500,  
            	url: '${appServer}/domainapptemplate/list-alldomain', 
            	buttons: [
                	{ text: '确定', onclick: f_selectContactOK },
                	{ text: '取消', onclick: f_selectContactCancel }
            	]
            });
            return false;
        }
        function f_selectContactOK(item, dialog)
        {
			var fn = dialog.frame.f_select || dialog.frame.window.f_select; 
            var data = fn(); 
            if (!data)
            {
                alert('请选择行!');
                return;
            }
            $("#templateId").val(data.id);
            dialog.close();
        }
        function f_selectContactCancel(item, dialog)
        {
            dialog.close();
        }
	 //-------------------domain end!!!----------------
	 
	 		
//-----------------app_template_id-start----------------------------------

 $(function ()
        { 
            $("#appTemplateId").ligerComboBox({
                onBeforeOpen: f_selectContact2, width:200
            });
        });
        function f_selectContact2()
        {
            $.ligerDialog.open({ 
            	title: '请选择应用模板ID', 
            	name:'winselector',
            	width: 700, 
            	height: 500,  
            	url: '${appServer}/domainapptemplate/list-allapptemplate', 
            	buttons: [
                	{ text: '确定', onclick: f_selectContactOK2 },
                	{ text: '取消', onclick: f_selectContactCancel2 }
            	]
            });
            return false;
        }
        function f_selectContactOK2(item, dialog)
        {
			var fn = dialog.frame.f_select || dialog.frame.window.f_select; 
            var data = fn(); 
            if (!data)
            {
                alert('请选择行!');
                return;
            }
            $("#appTemplateId").val(data.id);
            dialog.close();
        }
        function f_selectContactCancel2(item, dialog)
        {
            dialog.close();
        }
        
        
//-----------------app_template_id-end----------------------------------
 
});
</script>